import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
const defaultSettings = require("./src/enum/setting.js")
const proxyConfig = require('./src/enum/proxyConfig.js')
const port=defaultSettings.default.port
const openFlag=defaultSettings.default.openFlag
const proxyEnum=proxyConfig.default.proxy
// https://vitejs.dev/config/
export default defineConfig({
  // 基础配置
  server:{
    port: port,
    open:openFlag,
    proxy:proxyEnum
  },
  plugins: [
    vue(),
    vueJsx(),
  ],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  }
})
